package fr.resasante.spring3.controller.common;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.web.servlet.ModelAndView;

import fr.resasante.exception.ApplicationException;

public class ControllerAbstract {
	@Autowired
	protected MessageSource messageSource;

	protected ModelAndView forbidden(HttpServletResponse response) {
		try {
			response.sendError(HttpServletResponse.SC_FORBIDDEN);
		} catch (final IOException e) {
			throw new ApplicationException("Unable to put a 403 in the response", e);
		}
		return null;
	}
}
